package edu.sctu.xiangkun.day201505.day20150517;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

/**
 * Created by user08 on 2015/5/17.
 */

public class TextMore {

    List<Teacher> teacherlist = new ArrayList<>();

    List<Student> studentlist = new ArrayList<>();
    List<Student> studentlist1 = new ArrayList<>();
    List<Student> studentlist2 = new ArrayList<>();
    List<Student> studentlist3 = new ArrayList<>();
    List<Student> studentlist4 = new ArrayList<>();




    public List<Teacher> sotrNumber(){

        studentlist1.add(new Student("聂宇",65+""));
        studentlist1.add(new Student("吴丽霞",67+""));

        studentlist2.add(new Student("朱英志",56+""));

        studentlist3.add(new Student("向琨",98+""));
        studentlist3.add(new Student("秀丽",6+""));
        studentlist3.add(new Student("燕子",78+""));

        studentlist4.add(new Student("老郑",56+""));
        studentlist4.add(new Student("小红",79+""));
        studentlist4.add(new Student("杨旭",90+""));
        studentlist4.add(new Student("周春艳",90+""));


        teacherlist.add(new Teacher(2 + "", "黄开", "讲师", "大学英语","男",studentlist1 ));
        teacherlist.add(new Teacher(4 + "", "陈功锁", "助理", "C语言", "男",studentlist2));
        teacherlist.add(new Teacher(3+"","冉小娟","讲师","数据结构","男",studentlist3));
        teacherlist.add(new Teacher(5+"","冯凯平","教授","高等数学","女",studentlist4));

        Collections.sort(teacherlist);
        return teacherlist;
    }

    public List<Student> sortStudent(){



        for(int j = 0;j < teacherlist.size();j++){
            for (int i = 0; i < teacherlist.get(j).getStudents().size(); i++) {
                studentlist.add(teacherlist.get(j).getStudents().get(i));
            }
        }

        Collections.sort(studentlist);
        return studentlist;
    }

    public List<Teacher> pritCoded(){

        List<Teacher> list = new ArrayList<>();

        for(Teacher t : teacherlist){
            if(t.getTitle().equals("教授")){
                list.add(t);

            }
        }

        return list;
    }
}
